package git.jasonch.isp.controller;

import git.jasonch.isp.entity.Isp;
import git.jasonch.isp.service.IspService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * projectName : isp
 * className: TimerController
 * description: TODO 类描述
 *
 * @author : git.jas0nch
 * date: 2022-02-06
 */
@Controller
//@RestController
@RequestMapping("/timer")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class TimerController {

    private final IspService ispService;

    @GetMapping("/isp")
    public String test(){
//
        Isp isp = new Isp();
        isp.setName("jason");
        isp.setContent("访问网页:/timer/isp");
        int i = ispService.addIsp(isp);
        if (i != 0){
            System.out.println("访问了该网页:/timer/isp");
        }
        return "index";
    }
}
